x_max = 2*pi;
N = 200;
mu = -0.5;
max_iter = round(-N/mu);
numfine = 3;
a = 1;

stable_leapfrog_errmax1 = zeros(1,numfine+1);
for i = 1:numfine+1
    u = initial_data1(N,x_max);
    u = stable_leapfrog(u,N,mu,x_max,a,max_iter);
    exact_u = exact_solution1(N,mu,x_max,a,max_iter);
    stable_leapfrog_errmax1(i) = err(u,exact_u,2,x_max);
    N = N*2;
    max_iter = max_iter*2;
end
printOrder(stable_leapfrog_errmax1);